package com.example.demo.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.example.demo.custom.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * 绑定时间的洗美
 * @author DELL
 *
 */
@Entity
public class XiMei2 {
	private Integer id;
	private XiMei xiMei;//绑定洗美
	private Float caiLiaoPrice;//洗美材料价格
	private Float gongShiPrice;//洗美工时价格
	private Float caiLiaoCost;//洗美材料成本
	private Float gongShiCost;//洗美工时成本
	private Date beginDate;//起始修改时间
	private Date endDate;//结束修改时间

	public Float getCaiLiaoPrice() {
		return caiLiaoPrice;
	}
	public void setCaiLiaoPrice(Float caiLiaoPrice) {
		this.caiLiaoPrice = caiLiaoPrice;
	}
	public Float getGongShiPrice() {
		return gongShiPrice;
	}
	public void setGongShiPrice(Float gongShiPrice) {
		this.gongShiPrice = gongShiPrice;
	}
	

	public Float getCaiLiaoCost() {
		return caiLiaoCost;
	}
	public void setCaiLiaoCost(Float caiLiaoCost) {
		this.caiLiaoCost = caiLiaoCost;
	}
	public Float getGongShiCost() {
		return gongShiCost;
	}
	public void setGongShiCost(Float gongShiCost) {
		this.gongShiCost = gongShiCost;
	}
	
	@ManyToOne
	public XiMei getXiMei() {
		return xiMei;
	}
	public void setXiMei(XiMei xiMei) {
		this.xiMei = xiMei;
	}
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	
	
	@Id
	@GeneratedValue
	@JsonIgnore
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	
	
	@Transient
	public Integer getXimeiId() {
		return xiMei==null?null:xiMei.getId();
	}
	
	
}
